var express = require('express');

var router = express.Router();
var db=require('../M/db.js')

router.post('/',async (req,res,next) =>{//登录
    var xxi=req.body
    var navs=await db.find('nav',{user:req.body.user})
    if(navs.length ==0){
        res.send({
            code:400,
            mas:'邮箱不存在，清注册',
            xxi,
        })
    }else{
        var qqq=await db.xiugai('nav',{user:req.body.user},{passname:req.body.passname}).then((data)=>{
            res.send({
                code:200,
                mas:'修改密码成功',
            })
        })
    }
})

    module.exports=router